/**
 *  ward @ 2019
 *  harrydeep@wardyan.top
 */
package top.wardyan.po;

import java.util.List;
import java.util.Set;

import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;

import top.wardyan.base.config.Const;

/**
 * 
 * @author ward 2019年3月3日
 */
public class WCCombo extends CCombo{
	public WCCombo(Composite parent, int style) {
		this(parent, style, null, (List<String>)null, null);
	}
	
	public WCCombo(Composite parent, Integer style, Rectangle bound, String[] values, String def) {
		super(parent, style);
		
		if(bound != null)
			this.setBounds(bound);
		if(values != null)
			this.setItems(values);
		if(def != null && def.length() > 0)
			this.setText(def);
		else if(values != null && values.length > 0)
			this.select(0);
		this.setFont(Const.FONT_H8);
	}
	
	public WCCombo(Composite parent, Integer style, Rectangle bound, Set<String> values, String def) {
		this(parent, style, bound, values != null ? values.toArray(new String[] {}) : null, def);
	}
	
	public WCCombo(Composite parent, Integer style, Rectangle bound, List<String> values, String def) {
		this(parent, style, bound, values != null ? values.toArray(new String[] {}) : null, def);
	}

	@Override
	protected void checkSubclass() {}
	


}
